New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

download-file-with-progressbar

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

download-file-with-progressbar

a node package to download with progressbar

  • 1.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

Download file with progress bar

Require

  • node: ^6.0.0

use some ES6 feature, you can use babel to make it support node below 6.0.0

Install

npm install --save download-file-with-progressbar

Usage

const dl = require('download-file-with-progressbar');

option = {
	filename: 'the filename to store, default = path.basename(YOUR_URL) || "unknowfilename"',
	dir: 'the folder to store, default = os.tmpdir()',
	onDone: (info)=>{
		console.log('done', info);
	},
	onError: (err) => {
		console.log('error', err);
	},
	onProgress: (curr, total) => {
		console.log('progress', (curr / total * 100).toFixed(2) + '%');
	},
}

var dd = dl('YOUR_URL', option);

dd.abort() // to abort the download

Demo

progress 0.00%
progress 0.69%
progress 1.38%
progress 2.08%
progress 2.77%
progress 3.46%
...
...
...
progress 98.68%
progress 99.11%
progress 99.46%
progress 100.00%
done {
	path: '/var/folders/cd/gy7q816s141339zt56j83fg00000gn/T/MS-DOS.7.10.ISO',
	url: 'http://localhost:8000/MS-DOS.7.10.ISO',
	size: 9455616
}

License

this project uses SATA license (The Star And Thank Author License),anyway,you should star this repo before use.

More details: LICENSE文件。

Keywords

FAQs

Package last updated on 13 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc